package com.niiwoo.civet.trade.service.local.newRefund.notify.mq;

import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;

import org.springframework.amqp.core.Message;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;
import com.niiwoo.civet.trade.service.local.newRefund.notify.dto.RefundNotifyDTO;
import com.niiwoo.civet.trade.service.local.newRefund.notify.enums.RefundNotifyEnum;

/**
 * 融360还款计划变更通知
 * 
 * 触发条件：用户还款、非担保自动还款
 *  
 * @author: kevin.jia
 * @version 1.0.0
 */
@Component
public class R360RefundPlanChangeNotify extends MQRefundNotify {

	@Override
	public Object bulidParam(RefundNotifyDTO refundNotifyDTO) {
		Map<String, Long> map = new HashMap<>();
		map.put("projectId", refundNotifyDTO.getProject().getProjectId());
        return new Message(JSON.toJSONString(map).getBytes(Charset.forName("UTF-8")), null);
	}
	
	@Override
	public RefundNotifyEnum getType() {
		return RefundNotifyEnum.R360_REFUND_PLAN_CHANGE;
	}
}